<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>授权</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,maximum-scale=1,user-scalable=0,initial-scale=1">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
    <meta http-equiv="expires" content="0">
</head>
<style>

    .box-content {
        margin-top: 30%;
    }

    .auth-title {
        text-align: center;
        font-size: 16px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .content-box {
        margin-top: 50px;
        width: 100%;
        text-align: center;
    }

    .container {
        margin-top: 150px;
    }


    .auth-title-box {
        display: flex;
        justify-content: center;
        height: 30px;
    }

    .auth-title-img-box {
        height: 30px;
        width: 30px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .auth-title-img {
        height: 30px;
        width: 30px;
    }

    .btn-box {
        margin-top: 200px;
    }

    .submit-btn {
        height: 40px;
        border-radius: 20px;
        width: 60%;
        color: #FFFFFF;
        background-color: #5A90FA;
        font-size: 16px;
    }

    .reject-btn {
        margin-top: 20px;
        color: #000000;
        background-color: #F1F1F1;
    }

    button {
        border: none;
    }

    button:active {
        background-color: #3269DC;
    }

    .authorization-box {
        padding: 0 20px;
    }
    
    .user-info-box {
        padding: 10px 20px;
        border-top: #EEEEEE solid 1px;
        border-bottom: #EEEEEE solid 1px;
        display: flex;
    }

    .avatar {
        width: 50px;
        height: 50px;
    }


    .nick-name-box {
        padding-left: 10px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .nick-name {
        padding-top: 5px;
        font-size: 18px;
    }

    .tip {
        font-size: 14px;
        color: #BCBCBC;
    }

</style>
<body>
<div class="box-content">
    <div class="auth-title-box">
        <div class="auth-title-img-box">
            <img class="auth-title-img" th:src="@{/images/safeIcon.png}">
        </div>
        <h2 class="auth-title">授权提示</h2>
    </div>
    <div class="container">
        <div class="authorization-box">
           <h5>语若商城申请获取您的开放信息</h5>
        </div>
        <div class="user-info-box">
            <img class="avatar" th:src="${principal.avatar}" alt="">
            <div class="nick-name-box">
                <span class="nick-name" th:text="${principal.username} + '🍀'"></span>
                <span class="tip">会员昵称头像</span>
            </div>
        </div>
        <div class="content-box">
            <form method="post" action="/oauth/authorize">
                <input type="hidden" name="user_oauth_approval" value="true">
                <div class="btn-box" th:each="item:${scopes}">
                    <button class="content-item submit-btn" th:name="'scope.'+${item}" value="true" type="submit">同意授权</button>
                    <button class="content-item submit-btn reject-btn" th:name="'scope.'+${item}" value="false" type="submit">拒绝授权</button>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>
